#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<vector<int>> subsets(vector<int>& nums)
    {
        _subsets(nums, 0);
        return _ret;
    }

private:
    void _subsets(const std::vector<int>& nums, size_t curIndex)
    {
        if (curIndex == nums.size()) {
            _ret.emplace_back(_v);
            return;
        }

        _v.push_back(nums[curIndex]);
        _subsets(nums, curIndex + 1);
        _v.pop_back();

        _subsets(nums, curIndex + 1);
    }
    std::vector<int> _v;
    std::vector<std::vector<int>> _ret;
};